package com.cskaoyan._05protected.clonetest;

/**
 * @description:
 * @author: 景天
 * @date: 2023/2/9 11:18
 **/

public class Demo {
    public static void main(String[] args) throws CloneNotSupportedException {
        Student student = new Student();
        // student.clone();
        // Object属于java.lang
        // 自己定义的类 com.cskaoyan._05protected.clonetest;

        // 在Demo类中,创建子类自身对象,即Demo对象,可以访问
        Demo demo = new Demo();
        demo.clone();

        Teacher teacher = new Teacher();
        teacher.clone();
    }
}

class Student{

}

class Teacher{
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
